﻿<%@ Page Language="C#" MasterPageFile="~/Admin/Pages/Site.Master" AutoEventWireup="true" CodeBehind="Users.aspx.cs" Inherits="HBR_Prototype.Admin.Pages.Users" Title="Tài Khoản" %>

<%@ Register Assembly="DevExpress.Web.ASPxEditors.v8.1, Version=8.1.1.0, Culture=neutral, PublicKeyToken=49d90c14d24271b5"
  Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dxe" %>

<%@ Register Assembly="DevExpress.Web.ASPxGridView.v8.1, Version=8.1.1.0, Culture=neutral, PublicKeyToken=49d90c14d24271b5"
  Namespace="DevExpress.Web.ASPxGridView" TagPrefix="dxwgv" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
  <div class="settings">
    <h1>Tạo Tài Khoản Mới</h1>
    <asp:CreateUserWizard ID="CreateUserWizard" runat="server" CompleteSuccessText="Tạo Tài khoản thành công" ConfirmPasswordCompareErrorMessage="Mật khẩu và Xác nhận mật khẩu không khớp" ConfirmPasswordLabelText="Xác nhận Mật khẩu:" ConfirmPasswordRequiredErrorMessage="Yêu cầu xác nhận Mật khẩu." ContinueButtonText="Tiếp tục" CreateUserButtonText="Tạo tài khoản" DuplicateEmailErrorMessage="E-mail đã tồn tại." DuplicateUserNameErrorMessage="Tài khoản đã tồn tại." EmailRegularExpressionErrorMessage="E-mail không hợp lệ." EmailRequiredErrorMessage="Yêu cầu Email" PasswordLabelText="Mật Khẩu:" UserNameLabelText="Tên Tài Khoản:">
      <WizardSteps>
        <asp:CreateUserWizardStep ID="CreateUserWizardStep1" runat="server" Title="Tạo Tài Khoản Mới">
          <ContentTemplate>
            <table border="0">
              <tr>
                <td align="center" colspan="2">
                  </td>
              </tr>
              <tr>
                <td align="right">
                  <asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName">Tên Tài Khoản:</asp:Label></td>
                <td>
                  <asp:TextBox ID="UserName" runat="server"></asp:TextBox>
                  <asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UserName"
                    ErrorMessage="User Name is required." ToolTip="User Name is required." ValidationGroup="CreateUserWizard">*</asp:RequiredFieldValidator>
                </td>
              </tr>
              <tr>
                <td align="right">
                  <asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password">Mật Khẩu:</asp:Label></td>
                <td>
                  <asp:TextBox ID="Password" runat="server" TextMode="Password"></asp:TextBox>
                  <asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="Password"
                    ErrorMessage="Password is required." ToolTip="Password is required." ValidationGroup="CreateUserWizard">*</asp:RequiredFieldValidator>
                </td>
              </tr>
              <tr>
                <td align="right">
                  <asp:Label ID="ConfirmPasswordLabel" runat="server" AssociatedControlID="ConfirmPassword">Xác nhận Mật khẩu:</asp:Label></td>
                <td>
                  <asp:TextBox ID="ConfirmPassword" runat="server" TextMode="Password"></asp:TextBox>
                  <asp:RequiredFieldValidator ID="ConfirmPasswordRequired" runat="server" ControlToValidate="ConfirmPassword"
                    ErrorMessage="Yêu cầu xác nhận Mật khẩu." ToolTip="Yêu cầu xác nhận Mật khẩu."
                    ValidationGroup="CreateUserWizard">*</asp:RequiredFieldValidator>
                </td>
              </tr>
              <tr>
                <td align="right">
                  <asp:Label ID="EmailLabel" runat="server" AssociatedControlID="Email">E-mail:</asp:Label></td>
                <td>
                  <asp:TextBox ID="Email" runat="server"></asp:TextBox>&nbsp;
                </td>
              </tr>
              <tr>
                <td align="right">
                  <asp:Label ID="QuestionLabel" runat="server" AssociatedControlID="Question" Visible="False">Security Question:</asp:Label></td>
                <td>
                  <asp:TextBox ID="Question" runat="server" Visible="False"></asp:TextBox>&nbsp;
                </td>
              </tr>
              <tr>
                <td align="right">
                  <asp:Label ID="AnswerLabel" runat="server" AssociatedControlID="Answer" Visible="False">Security Answer:</asp:Label></td>
                <td>
                  <asp:TextBox ID="Answer" runat="server" Visible="False"></asp:TextBox>&nbsp;
                </td>
              </tr>
              <tr>
                <td align="center" colspan="2">
                  <asp:CompareValidator ID="PasswordCompare" runat="server" ControlToCompare="Password"
                    ControlToValidate="ConfirmPassword" Display="Dynamic" ErrorMessage="Mật khẩu và Xác nhận mật khẩu không khớp"
                    ValidationGroup="CreateUserWizard"></asp:CompareValidator>
                </td>
              </tr>
              <tr>
                <td align="center" colspan="2" style="color: red">
                  <asp:Literal ID="ErrorMessage" runat="server" EnableViewState="False"></asp:Literal>
                </td>
              </tr>
            </table>
          </ContentTemplate>
        </asp:CreateUserWizardStep>
        <asp:CompleteWizardStep ID="CompleteWizardStep1" runat="server" Title="Tạo Tài Khoản Thành Công">
        </asp:CompleteWizardStep>
      </WizardSteps>
    </asp:CreateUserWizard>
  </div>
  <dxwgv:ASPxGridView ID="ASPxGridViewUser" runat="server" AutoGenerateColumns="False">
    <Settings ShowFilterRow="True" />
    <Columns>
      <dxwgv:GridViewCommandColumn VisibleIndex="0">
        <EditButton Visible="True" Text="Sửa">
        </EditButton>
        <DeleteButton Visible="True" Text="X&#243;a">
        </DeleteButton>
        <ClearFilterButton Visible="True">
        </ClearFilterButton>
        <CancelButton Text="Bỏ qua">
        </CancelButton>
        <HeaderStyle HorizontalAlign="Center" />
      </dxwgv:GridViewCommandColumn>
      <dxwgv:GridViewDataTextColumn Caption="Tên tài khoản" VisibleIndex="1" Width="150px">
        <PropertiesTextEdit>
          <ValidationSettings>
            <RequiredField ErrorText="Yêu cầu tài khoản" IsRequired="True" />
          </ValidationSettings>
        </PropertiesTextEdit>
        <HeaderStyle HorizontalAlign="Center" />
      </dxwgv:GridViewDataTextColumn>
      <dxwgv:GridViewDataTextColumn Caption="Mật khẩu" VisibleIndex="2" Width="100px">
        <PropertiesTextEdit Password="True">
          <ValidationSettings>
            <RequiredField ErrorText="Yêu cầu mật khẩu" IsRequired="True" />
          </ValidationSettings>
        </PropertiesTextEdit>
        <HeaderStyle HorizontalAlign="Center" />
      </dxwgv:GridViewDataTextColumn>
      <dxwgv:GridViewDataTextColumn Caption="Email" VisibleIndex="3" Width="200px">
        <PropertiesTextEdit>
          <ValidationSettings ErrorText="">
            <RegularExpression ErrorText="Email không hợp lệ" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" />
          </ValidationSettings>
        </PropertiesTextEdit>
        <HeaderStyle HorizontalAlign="Center" />
      </dxwgv:GridViewDataTextColumn>
      <dxwgv:GridViewDataCheckColumn Caption="Admin" VisibleIndex="4" Width="100px">
        <HeaderStyle HorizontalAlign="Center" />
      </dxwgv:GridViewDataCheckColumn>
      <dxwgv:GridViewDataCheckColumn Caption="Chuyên gia" VisibleIndex="5" Width="100px">
        <HeaderStyle HorizontalAlign="Center" />
      </dxwgv:GridViewDataCheckColumn>
    </Columns>
    <SettingsPager SEOFriendly="Enabled">
      <Summary AllPagesText="Trang: {0} - {1} ({2} tài khoản)" Text="Trang {0} trên {1} ({2} tài khoản)" />
    </SettingsPager>
  </dxwgv:ASPxGridView>
</asp:Content>

